class StateManager:
    def __init__(self):
        self.state = {}  # 初始化状态存储为字典

    def set_state(self, key, value):
        self.state[key] = value

    def get_state(self, key):
        return self.state.get(key)

    def get_all_state(self):
        return self.state

    def delete_state(self, key):
        self.state.pop(key, None)


state_manager = StateManager()


def get_state_manager():
    return state_manager
